<template>
    <ShowCount :count="count"/>
    <SetCount @onPlus="onPlus" @onMinus="onMinus" @setcount="setcount" :count="count"/>
</template>

<script setup>
import { ref } from 'vue';
import SetCount from './SetCount.vue';
import ShowCount from './ShowCount.vue';
const count = ref(0)

// 加
function onPlus(){
    count.value++;
}
// 减
function onMinus(){
    count.value--;
}
function setcount(data){
    count.value = data;
}
</script>

<style scoped>

</style>